using UnityEngine;
using System.Collections;

public class GUICrosshair : MonoBehaviour {

    private Rect m_Position;

    public Texture2D m_CrossHairTexture;

   

	void Start () {
        Screen.showCursor = false;
	}
	
	// Update is called once per frame
	void Update () {
	    
	}

    void OnGUI()
    {
        Vector2 MousePos = Event.current.mousePosition;

       

        //Calculate Position
        m_Position = new Rect(MousePos.x - (m_CrossHairTexture.width / 2), MousePos.y - (m_CrossHairTexture.height / 2), m_CrossHairTexture.width, m_CrossHairTexture.height);
 
        // Draw Crosshair
        GUI.DrawTexture(m_Position, m_CrossHairTexture);
        
    }
}
